<div id="slideshow" class="slideshow">
    <ul class="img">
    <?php foreach ($banners as $banner) { ?>
        <?php if ($banner['link']) { ?>
        <li style="background:#ccc;">
            <a href="<?php echo $banner['link']; ?>"><img src="<?php echo $banner['image']; ?>" alt="<?php echo $banner['title']; ?>" title="<?php echo $banner['title']; ?>" /></a>
        </li>
        <?php } else { ?>
        <li style="background:#ccc;">
            <a href="#"><img src="<?php echo $banner['image']; ?>" alt="<?php echo $banner['title']; ?>" title="<?php echo $banner['title']; ?>" /></a>
        </li>
        <?php } ?>
    <?php } ?>
    </ul>
</div>